package com.hh.game.service.gateway.filter.security;

public enum SecurityEnum {
    /**
     * 不需要权限
     */
    NONE("none"),
    /**
     * 只需要登录
     */
    LOGIN("login"),
    /**
     * 特定权限
     */
    PERM("perm"),
    ;

    private String permission;

    SecurityEnum(String permission) {
        this.permission = permission;
    }

    public static SecurityEnum parseVal(String val) {
        if(val == null){
            return null;
        }
        val = val.toUpperCase();
        switch (val) {
            case "NONE":
                return NONE;
            case "LOGIN":
                return LOGIN;
            case "PERM":
                return PERM;
            default:
                return null;
        }
    }
}
